import Vue from "vue"
import Vuex from 'vuex'
Vue.use(Vuex);


const pathRouter = {
    pathRoutering:''
}
const Tickcollect = {
    Tickcollecting:0
}

export default new Vuex.Store({
    state:{
        pathRouter,
        dest_detail: [],
        homeAmap:'',
        num:0,
        dest_detail: [],
        // 局部刷新删除后的页面
        Tickcollect
       
    },
    getters: {
        get_dest_detail(state) {
            return state.dest_detail;
        }
    },
    mutations:{
        // 通过路由解决导航刷新样式回到默认值
        pathrouters(state,path){
            state.pathRouter.pathRoutering = path
        },
        num(state,numm){
            // console.log(111111,numm)
            state.num=numm
        },
        load_dest_detail(state, dest) {
            state.dest_detail = dest;
        },
        // 地图
        Amap(state,maps){
            console.log('---------',maps);
            state.homeAmap = maps
            // 顺便给本地存储一份
            window.localStorage.setItem('Amap',maps)
        },

        Tickcollects(state,tick){
            state.Tickcollect = {
                Tickcollecting:tick
            }
        },
    }

})